<!-- 视图复选框 -->

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import ViewCheckbox from '@admin/views/Secure/mixMap/MapView/ViewCheckbox'

// ============================== 导出组件 ============================== //

export default CORE.extend(ViewCheckbox, {
  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb('map', 'map_'), CORE.mixSelect('firefighting', 'firefighting_')],

  /**
   * 计算属性 (慎用箭头函数)
   */
  computed: {
    /**
     * 消防类型字典
     */
    typeDict() {
      const { map_list, firefighting_selectDict: typeDict } = this
      return typeDict.map((dict) => {
        const matched = map_list.filter((item) => item.pointTypeCode === dict[0])
        return [...dict, matched.length]
      })
    },
  },
})
</script>
